'''
Author: your name
Date: 2020-11-05 16:56:39
LastEditTime: 2020-11-05 16:59:13
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \python-study\djangoS\app01\app01\Views\createByORM.py
'''
from django.shortcuts import render,HttpResponse
from Models.models import Book

class BookORM():
    def add_book(request):
        books = Book.objects.create(title="如来神掌",price=200,publish="功夫出版社",pub_date="2010-10-10")
        print(books, type(books)) # Book object (18)
        return HttpResponse("<p>数据添加成功！</p>")